#pragma once

#include "Effect.h"

#include <D3D10.h>
#include <D3D10Effect.h>
#include <DirectXmath.h>

#include <string>

#include "Light.h"

namespace D3D10Effects
{
    class SkyEffect : public Effect
    {
    public:
        SkyEffect(ID3D10Device * const device, const std::wstring& filename);
        virtual ~SkyEffect();

        __forceinline void setWorldViewProjectionMatrix(DirectX::XMFLOAT4X4A& matrix);
        __forceinline void setCubeMap(ID3D10ShaderResourceView * const cubeMap);

        ID3D10EffectTechnique* mTechnique;
		
		ID3D10EffectMatrixVariable* mWVP;
		ID3D10EffectShaderResourceVariable* mCubeMap;
    };
        
    void SkyEffect::setWorldViewProjectionMatrix(DirectX::XMFLOAT4X4A& matrix)
    {
        mWVP->SetMatrix(reinterpret_cast<float*> (&matrix));
    }

    void SkyEffect::setCubeMap(ID3D10ShaderResourceView * const cubeMap)
    {
        mCubeMap->SetResource(cubeMap);
    }
}
